package com.flymobi.admin;

import java.io.File;

import com.flymobi.fw.util.FileUtil;
import com.flymobi.po.Manager;
import com.flymobi.util.C;
import com.flymobi.util.WebContext;
import com.flymobi.util.WebUtil;

public class UploadAction extends WebAction {
	/**
	 * Comment for <code>serialVersionUID</code>
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	private String method;
	public String getId() {
		return id;
	}

	public String getMethod() {
		return method;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	@Override
	public String webProcess(WebContext context, Manager manager) {
		String callback = context.getRequest().getParameter("CKEditorFuncNum");
		File file = upload.get(0);
		String fileName=uploadFileName.get(0);
		String path=FileUtil.upfile(file,fileName);
		WebUtil.printStream(context,"<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction("
						+ callback + ",'http://wapimg1.huanqiu.com/" + path + "')</script>",false);
		return null;
	}

	/* (non-Javadoc)
	 * @see com.camel.admin.WebAction#getSysLog()
	 */
	@Override
	public String getSysLog() {
		// TODO Auto-generated method stub
		return null;
	}
}
